Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
What happens when you run the “build” script in parcel?

I’m a confused on what exactly the build script does and how it relates to deployment.

I know it it makes your project small by renaming variables, trimming white space, etc… but how does it work with deployment?

Do you only push the files that are generated by the build script?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

parcel build is used to create a production-ready bundle of files that can be deployed in various ways.

A very common workflow is to point parcel at an html file to build a client-side application that can be delivered by a file server (e.g. parcel build src/index.html). In this scenario, all the JavaScript is run by the user's browser, and the server is only responsible for serving the static files created by parcel build.

The core of the Heroku is a platform is focused on running server apps - i.e. apps that run most or a lot of their code on a server, not the browser. You mentioned the heroku "start" script (see docs), which is used in the context of such apps. If you're writing a heroku server application in, for example, nodejs, the start script would tell heroku what javascript file was the entry point to your node application (e.g. "start": "node dist/index.js". If you wanted to use parcel in such a project (e.g. to reduce the size of your server-side code so that heroku dynos might start up faster), you could run it in the context of a "build" command (e.g. "build": "parcel build/src/index.js").

If your application is entirely static html/js/css (i.e. the first scenario), I might consider another hosting platform like cloudflare pages or Amazon Amplify, which will probably be cheaper, faster and simpler. But if you want to use heroku, you need to set it up so that there is server code running that will deliver the static html/js/css files generated by parcel. There are many ways to do this - one would be to build a simple express app with the serve-static middleware, as described here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!